package gui.table;

import models.DatabaseModel;

/**
 * Interface for extracting displayable data (strings) from a <code>DatabaseModel</code>.
 */
public interface TableView <Model extends DatabaseModel> {
	
	/**
	 * Get the names of the fields as returned by {@link #getFields}, e.g. {"first name", "last name"}
	 * @return names of the fields
	 */
	public String[] getHeaders();
	
	/**
	 * Extract fields from the DatabaseModel, e.g. {"Peter", "Smith"}.
	 * 
	 * This method must return an array of the same length as the array returned by {@link #getHeaders}
	 * 
	 * @param model DatabaseModel to extract the data from
	 * @return fields
	 */
	public String[] getFields(Model model);
	
}
